public class Test {
    public static void merge(int A[], int m, int B[], int n) {
        int m1=m-1;
        int n1=n-1;
        int m2=m+n-1;
        while(m1>=0&&n1>=0){
            if(A[m1]>B[n1]){
                A[m2--]=A[m1--];
            }else{
                A[m2--]=B[n1--];
            }
        }
        while(n1>=0){
            A[m2--]=B[n1--];
        }
    }

    public static void main1(String[] args) {
        int[] A={4,5,6,0,0,0};
        int[] B={1,2,3};
        int m=3;
        int n=3;
        merge(A,m,B,n);
        for (int i = 0; i < A.length; i++) {
            System.out.println(A[i]);
        }
    }

    public static String setstring (String str) {
        char[] arr = new char[str.length()];
        for (int i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            arr[i] = ch;
        }
        return arr.toString();
    }

    public static void main(String[] args) {
        System.out.println(setstring("hello"));
    }
}
